<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link rel="stylesheet" type="text/css" href="./CSS/tv_control.css" />
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
</head>

<body>
<div><p id="text_area0">电视机控制</p></div>
<div id="tv_control">
<div id="main"> 
<div id="text_area1">1#电视机</div>
<div id="text_area2">2#电视机</div>
<div id="first">
<input name="first_up" type="button" option="1" value="开" />
<input name="first_down" type="button" option="2" value="关" />
<input name="first_pc" type="button"  option="3" value="电脑信号" />
<input name="first_video" type="button"  option="4" value="视频信号" />
</div>
<div id="second">
<input name="second_up" type="button" option="1" value="开" />
<input name="second_down" type="button" option="2" value="关" />
<input name="second_pc" type="button" option="3" value="电脑信号" />
<input name="second_video" type="button" option="4"  value="视频信号" />
</div>
</div>
</div>

<script>

	$("#first > input").click(function(){

		var json = $(this).attr("name");
  
  alert("1#机 "+json);

	
/*  uncomment this to verify cgi call
  $.get("./cgi-bin/tv_control.cgi?name=dianshi1&option="+json, function(result){
   alert(result);
  }); 
 */

})
	
	$("#second > input").click(function(){



		var json = $(this).attr("name");
  
	     

     

	

	alert("2#机 "+json);

	
	/* uncomment this to verify cgi call
	   $.ajax({		  
       type: "get",		  
       url: "./cgi-bin/tv_control.cgi",
       data:"name=dianshi2&option="+json	,	 
       success: function(result){			 alert( "Server side Says：" + result );		 
     }		
  }); 
  
  */


		

	})

</script>
</body>
</html>
